package com.wjj.service;

import com.wjj.dao.po.StudentPO;
import com.wjj.dto.StudentDTO;

/**
 * @Description
 * @Author junjun Wang
 * @Date Create in 0:40 2023/12/7
 **/
public class StudentMapper {

	public static StudentDTO fromStudentPO(StudentPO studentPO) {
		return StudentDTO.builder()
				.studentId(studentPO.getStudentId())
				.studentName(studentPO.getStudentName())
				.studentAge(studentPO.getStudentAge())
				.studentGender(studentPO.getStudentGender())
				.classId(studentPO.getClassId())
				.build();
	}

	public static StudentPO toStudentPO(StudentDTO studentDTO) {
		return StudentPO.builder()
				.studentId(studentDTO.getStudentId())
				.studentName(studentDTO.getStudentName())
				.studentAge(studentDTO.getStudentAge())
				.studentGender(studentDTO.getStudentGender())
				.classId(studentDTO.getClassId())
				.build();
	}

}
